----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/figure_A8_alt_transfer_costs.log
  log type:  text
 opened on:   7 Nov 2022, 15:24:45

. *-------------------------------------------------------------------------------
. 
. 
. *Assuming the technology transfer costs have an origin-specific component
. *-----------------------------------------------------------------
. clear all

. use year isocode type D_A* using "${data}/estimates_agg_naics_sales_s1_base_woparent.dta", clear

. 
. 
. *Assuming the technology transfer costs have an detination-specific component
. *-----------------------------------------------------------------
. merge 1:1 year isocode type using "${data}/estimates_agg_naics_sales_s1_base_withparent.dta", keepusing(D_P*)

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                27  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(0 observations deleted)

. drop _merge

. 
. 
. foreach xx in D_A D_P {
  2. gen u_`xx' = `xx' + 1.96 * `xx'_se
  3. gen l_`xx' = `xx' - 1.96 * `xx'_se 
  4. }

. keep year isocode type *D_A* *D_P*

. gsort D_A

. drop year

. 
. gen t=_n

. sum t

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
           t |         27          14    7.937254          1         27

. 
. forvalues ii=1(1)`r(max)' {
  2. local ctry`ii' = isocode[`ii']
  3. local obs`ii' = `ii'
  4. display "`ctry`ii'' ; `obs`ii''"
  5. }
JP ; 1
DE ; 2
IT ; 3
KR ; 4
FR ; 5
GB ; 6
ES ; 7
MX ; 8
PL ; 9
BE ; 10
AT ; 11
NL ; 12
RO ; 13
FI ; 14
SE ; 15
PT ; 16
GR ; 17
CZ ; 18
HU ; 19
DK ; 20
SK ; 21
HR ; 22
BG ; 23
SI ; 24
LV ; 25
LT ; 26
EE ; 27

. *
. 
. twoway rcap u_D_A l_D_A t, lc(red) /// 
> ||     rcap u_D_P l_D_P t, lc(blue) /// 
> ||     scatter D_A t, mc(red)  /// 
> ||     scatter D_P t, mc(blue)  ///
> yline(0) yline(0) ylab(-2(1)4) xlab(1(1)25)  legend(off) xlabel(, valuelabel) xlabel(, angle(45)) ytitle("") xtitle("") graphregion(fcolor(white) lcolor(white)) xlabel(`obs1' "
> `ctry1'" `obs2' "`ctry2'"  `obs3' "`ctry3'" `obs4' "`ctry4'" `obs5' "`ctry5'" `obs6' "`ctry6'" `obs7' "`ctry7'" `obs8' "`ctry8'" `obs9' "`ctry9'" `obs10' "`ctry10'" `obs11' "`c
> try11'" `obs12' "`ctry12'" `obs13' "`ctry13'" `obs14' "`ctry14'" `obs15' "`ctry15'" `obs16' "`ctry16'" `obs17' "`ctry17'" `obs18' "`ctry18'" `obs19' "`ctry19'" `obs20' "`ctry20
> '"  `obs21' "`ctry21'" `obs22' "`ctry22'" `obs23' "`ctry23'" `obs24' "`ctry24'" `obs25' "`ctry25'" `obs26' "`ctry26'" `obs27' "`ctry27'", labsize(small)) 

. 
. graph export "${rappendix}/fig_A8_alt_transfer_costs.pdf", replace
(file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/fig_A8_alt_transfer_costs.pdf written
>  in PDF format)

. 
.         
. log close 
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/figure_A8_alt_transfer_costs.log
  log type:  text
 closed on:   7 Nov 2022, 15:24:47
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
